package com.hkyp.ss.course.provider.repository.mediate;

import com.hkyp.ss.course.provider.model.mediate.UURelation;
import com.hkyp.ss.course.provider.repository.baseRepository.BaseRepository;

import java.util.List;
import java.util.Set;

public interface UURelationRepository extends BaseRepository<UURelation,Long> {

    /**
     *  查询用户的关注数
     * sql: select count(uurelation0_.id) as col_0_0_ from uurelation uurelation0_ where uurelation0_.from_id=?
     * 测试通过
     */
    Integer countByFromId(Long fromId);

    UURelation findByFromIdAndToId(Long fromId, Long toId);

    /**
     *
     *
     */
    List<UURelation> findAllByToIdInAndFromIdEquals(Set<Long> toIds, Long fromId);

}